﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:Primitives="clr-namespace:Microsoft.Windows.Controls.Ribbon.Primitives;assembly=RibbonControlsLibrary"
		xmlns:Ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
		xmlns:ext="clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"
		xmlns:System="clr-namespace:System;assembly=mscorlib">
	<Style TargetType="Ribbon:RibbonContextualTabGroup">
		<Setter Property="ext:WindowChrome.IsHitTestVisibleInChrome" Value="True" />
		<Setter Property="BorderThickness" Value="0,4,0,0" />
		<Setter Property="FontSize" Value="11" />
		<Setter Property="Padding" Value="0" />
		<Setter Property="Margin" Value="1,0,1,-30" />
		<Setter Property="Height" Value="53" />
		<!-- 53, 48 -->
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Ribbon:RibbonContextualTabGroup}">
					<ControlTemplate.Resources>
						<DataTemplate x:Key="{DataTemplateKey DataType={x:Type System:String}}"
								DataType="{x:Type System:String}">
							<TextBlock Text="{TemplateBinding Content}" TextTrimming="CharacterEllipsis" />
						</DataTemplate>
					</ControlTemplate.Resources>
					<Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Background="{TemplateBinding Background}" RenderOptions.ClearTypeHint="Enabled"
							Padding="{TemplateBinding Padding}" Opacity="0">
						<ContentPresenter Content="{TemplateBinding Header}"
								ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header"
								Margin="2,4,2,0" VerticalAlignment="Top" IsHitTestVisible="False" />
					</Border>
					<ControlTemplate.Triggers>
						<DataTrigger Binding="{Binding HighContrast}" Value="True">
							<Setter Property="Background" TargetName="OuterBorder"
									Value="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" />
							<Setter Property="BorderBrush" TargetName="OuterBorder" Value="Transparent" />
							<Setter Property="Foreground"
									Value="{DynamicResource {x:Static SystemColors.ActiveCaptionTextBrushKey}}" />
						</DataTrigger>
						<Trigger Property="IsVisible" Value="True">
							<Trigger.EnterActions>
								<BeginStoryboard>
									<Storyboard>
										<DoubleAnimation To="0" Duration="0" Storyboard.TargetName="OuterBorder"
												Storyboard.TargetProperty="Opacity" />
										<DoubleAnimation From="0" To="1" Duration="0:0:0.3" BeginTime="0:0:0.5"
												Storyboard.TargetName="OuterBorder" Storyboard.TargetProperty="Opacity" />
										<ThicknessAnimation From="0,20,0,-20" To="0" Duration="0:0:0.3"
												BeginTime="0:0:0.5" Storyboard.TargetName="OuterBorder"
												Storyboard.TargetProperty="Margin">
											<ThicknessAnimation.EasingFunction>
												<QuarticEase EasingMode="EaseOut" />
											</ThicknessAnimation.EasingFunction>
										</ThicknessAnimation>
									</Storyboard>
								</BeginStoryboard>
							</Trigger.EnterActions>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>